package jehc.djshi.sys.service.impl;
import java.util.List;
import java.util.Map;

import jehc.djshi.sys.dao.XtSmsDao;
import jehc.djshi.sys.model.XtSms;
import jehc.djshi.sys.service.XtSmsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import jehc.djshi.common.base.BaseService;
import jehc.djshi.common.util.ExceptionUtil;

/**
 * @Desc 短信配置
 * @Author 邓纯杰
 * @CreateTime 2012-12-12 12:12:12
 */
@Service("xtSmsService")
public class XtSmsServiceImpl extends BaseService implements XtSmsService {
	@Autowired
	private XtSmsDao xtSmsDao;
	/**
	* 分页
	* @param condition 
	* @return
	*/
	public List<XtSms> getXtSmsListByCondition(Map<String,Object> condition){
		try{
			return xtSmsDao.getXtSmsListByCondition(condition);
		} catch (Exception e) {
			throw new ExceptionUtil(e.getMessage(),e.getCause());
		}
	}
	/**
	* 查询对象
	* @param xt_sms_id 
	* @return
	*/
	public XtSms getXtSmsById(String xt_sms_id){
		try{
			return xtSmsDao.getXtSmsById(xt_sms_id);
		} catch (Exception e) {
			throw new ExceptionUtil(e.getMessage(),e.getCause());
		}
	}
	/**
	* 添加
	* @param xtSms
	* @return
	*/
	public int addXtSms(XtSms xtSms){
		int i = 0;
		try {
			xtSms.setCreate_id(getXtUid());
			xtSms.setCreate_time(getDate());
			i = xtSmsDao.addXtSms(xtSms);
		} catch (Exception e) {
			throw new ExceptionUtil(e.getMessage(),e.getCause());
		}
		return i;
	}
	/**
	* 修改
	* @param xtSms
	* @return
	*/
	public int updateXtSms(XtSms xtSms){
		int i = 0;
		try {
			xtSms.setUpdate_time(getDate());
			xtSms.setUpdate_id(getXtUid());
			i = xtSmsDao.updateXtSms(xtSms);
		} catch (Exception e) {
			throw new ExceptionUtil(e.getMessage(),e.getCause());
		}
		return i;
	}
	/**
	* 删除
	* @param condition 
	* @return
	*/
	public int delXtSms(Map<String,Object> condition){
		int i = 0;
		try {
			i = xtSmsDao.delXtSms(condition);
		} catch (Exception e) {
			throw new ExceptionUtil(e.getMessage(),e.getCause());
		}
		return i;
	}
}
